package com.gxa.order.controller;

import com.gxa.common.base.RespResult;
import com.gxa.common.page.AccommodationQueryPage;
import com.gxa.order.service.AccommodationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 住宿订单管理
 * 分页查看住宿订单 / 查询订单 （根据国家、关键词进行搜索）
 * 创建订单
 * 查看订单详情
 * 切换订单状态 【待支付，即将入住，入住中，申请退款，审核不通过，待退款，已退款，已退房，已过期】
 * @author MacieSerenity
 */
@RestController
@RequestMapping("/order")
public class AccommodationController {
    final
    AccommodationService accommodationService;

    @Autowired
    public AccommodationController(AccommodationService accommodationService) {
        this.accommodationService = accommodationService;
    }

    @PostMapping("/accommodation/list")
    public RespResult listAccommodationByQueryPage(@RequestBody AccommodationQueryPage accommodationQueryPage) {
        return accommodationService.listAccommodationByQueryPage(accommodationQueryPage);
    }
}
